package top.xierongsheng.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.xierongsheng.user.dao.AreaMapper;
import top.xierongsheng.user.model.SysArea;
import top.xierongsheng.user.service.IAreaService;

/**
 * 地区表 服务实现类
 *
 * @auther 谢荣生
 * @datetime 2020/10/16 17:23
 */
@Service
public class AreaServiceImpl extends ServiceImpl<AreaMapper, SysArea> implements IAreaService {

    @Autowired
    private AreaMapper areaMapper;

    /**
     * 根据地区id获取详情
     *
     * @param areaId
     * @return
     */
    @Override
    public SysArea getByAreaId(Integer areaId) {
        return areaMapper.selectOne(new QueryWrapper<SysArea>().lambda().eq(SysArea::getAreaId, areaId));
    }
}
